<template>
  <div class="myContainer">
    <el-row class="myTitleBorderBottom myMarginBottom_10px">
      <el-col :span="12" class="myLineHeight_40px">
        基本信息
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         任务名称:
      </el-col>
      <el-col :span="7">
        <el-input placeholder="请输入任务名称" v-model="detail.name" :readonly="is_modifly"></el-input>
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         任务ID:
      </el-col>
      <el-col :span="7">
        <el-input placeholder="任务ID" v-model="detail.id" :readonly="is_modifly"></el-input>
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         执行人:
      </el-col>
      <el-col :span="7">
        <el-input placeholder="请输入执行人" v-model="detail.commit_username" :readonly="is_modifly"></el-input>
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         联系电话:
      </el-col>
      <el-col :span="7">
        <el-input placeholder="执行人联系电话" v-model="detail.commit_userphone" :readonly="is_modifly"></el-input>
      </el-col>
    </el-row>
    <el-row class="myTitleBorderBottom myMarginBottom_10px">
      <el-col :span="12" class="myLineHeight_40px">
        巡检信息
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         巡检时间:
      </el-col>
      <el-col :span="7" class="myLineHeight_40px">
        <el-input placeholder="巡检时间" v-model="detail.commit_time" :readonly="is_modifly"></el-input>
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         巡检对象:
      </el-col>
      <el-col :span="7" class="myLineHeight_40px">
        <el-input placeholder="巡检对象" v-model="detail.targetnames" :readonly="is_modifly"></el-input>
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         巡检结论:
      </el-col>
      <el-col :span="7" class="myLineHeight_40px">
        <el-input placeholder="巡检结论" v-model="result" :readonly="is_modifly"></el-input>
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         文字说明:
      </el-col>
      <el-col :span="17">
        <el-input type="textarea" placeholder="备注" v-model="detail.note" :readonly="is_modifly"></el-input>
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="3" class="myLeftMsg">
         图片信息:
      </el-col>
      <el-col :span="17">
        <img v-for="i in detail.urls" :src=i.url width="300" style="margin-right: 10px;">
      </el-col>
    </el-row>
    <el-row class="myPaddingBottom_10px">
      <el-col :span="7" :offset="3">
        <el-button type="primary" class="myBgGreen" @click="onBack">返 回</el-button>
      </el-col>
    </el-row>
  </div>
</template>
<style scoped>
  .myContainer{
    background: #fff;
    padding: 10px;
  }
  .myTitleBorderBottom{
    color: #000;
    font-weight: 500;
    font-size: 16px;
    border-bottom: 1px solid #dbdbdb;
  }
  .myBgGreen{
    background: #00c2a9;
    border-color: #00c2a9;
    color: #fff;
    margin-top:2px;
  }
  .myBgGreen:hover{
    background: #33ceba;
  }
  .myTextAlignRight{
    text-align: right;
  }
  .myLineHeight_40px{
    line-height: 40px;
  }
  .myMarginTop_10px{
    margin-top: 10px;
  }
  .myLeftMsg{
    line-height: 40px;
    text-align: right;
    padding-right: 10px;
  }
  .myPaddingBottom_10px{
    padding-bottom: 10px;
  }
  .myVA_M{
    vertical-align: middle;
  }
  .myMarginBottom_10px{
    margin-bottom: 20px;
  }
  .myOV_y_400px{
    max-height: 400px;
    overflow-y:scroll; 
  }
</style>
<script>
  import { getInsepectionDetail } from '@/api/routinginspectionplan';
  export default {
    data(){
      return{
        title: "日常巡检详情",
        id: "",
        is_modifly:true,
        type:"",
        ad_name:"",
        detail:{},
        result:0,
      }
    },
    components: {
        
    },
    mounted(){
      document.title = this.title;
    },
    created(){
      document.title=this.title;
      this.id = this.$route.query.id;
      this.onGetInsepectionDetail();
      
    },
    methods:{     
      onEditAd(){
        
      },
      onCreate(){//添加
        
      },
      onBack(){//返回
        this.$router.go(-1);
      },
      onGetInsepectionDetail(){
        getInsepectionDetail(this.id).then(response => {
          let res=response.data;
          this.detail=res;
          this.result=res.result==0?"正常":"异常";
          console.log(res)
        }).catch(error => {
          console.log(error)
        })
      }

    }
  
  }


</script>



